package com.zy.aop.excerse1;


import java.lang.reflect.Proxy;

/**
 * Created by zy on 2015/10/25.
 */
public class aopTest1 {
    public static void main(String[] args) {
        Class[] proxyInterface = new Class[]{IBusiness.class, IBusiness2.class};
        LogInvocationHandler logInvocationHandler = new LogInvocationHandler(new Business());
        ClassLoader classLoader = aopTest1.class.getClassLoader();
        IBusiness2 proxyBusiness = (IBusiness2) Proxy.newProxyInstance(classLoader, proxyInterface, logInvocationHandler);
        proxyBusiness.doSomeThing2();
        ((IBusiness) proxyBusiness).doSomeThing();
    }
}
